package org.learn.intermediate.homework;

public class HomeWork08 {
    public static void main(String[] args) {

        try {
            if(args.length != 2){
                throw new ArrayIndexOutOfBoundsException("参数个数不对");
            }
            //
            int n1 = Integer.parseInt(args[0]);
            int n2 = Integer.parseInt(args[1]);
            //
            double res = cal(n1,n2);
            System.out.println("计算结果=" + res);
            //
        } catch (ArrayIndexOutOfBoundsException e) {
            e.printStackTrace();
        }catch (NumberFormatException e){
            System.out.println("你输入的格式不对");
        }catch (ArithmeticException e){
            System.out.println("出现了除以零的异常");
        }
        String n1 = "abc";
        n1.intern();
    }

    public  static double cal(int n1 , int n2){
        return n1 / n2;
    }
}
